<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">


    {if $row.pid>0}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2" style="text-align:left; padding-left:50px; white-space:nowrap;">{:__('父级')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-pid" data-rule="required" min="0" data-source="questioncategory/search" class="form-control selectpage" {$pid_data_params} name="row[pid]" type="text" value="{$row.pid|htmlentities}">
        </div>
    </div>
    {/if}

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2" style="text-align:left; padding-left:50px; white-space:nowrap;">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>


    {if $row.pid==0}

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2" style="text-align:left; padding-left:50px; white-space:nowrap;">{:__('图标')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" data-rule="" class="form-control" size="50" name="row[image]" type="text" value="{$row.image}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> 上传</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> 选择</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    {/if}




    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2" style="text-align:left; padding-left:50px; white-space:nowrap;">{:__('排序')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" min="0" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2" style="text-align:left; padding-left:50px; white-space:nowrap;">{:__('Course_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-course_id" data-rule="required" min="0"  class="form-control" name="row[course_id]" type="hidden" value="{$row.course_id|htmlentities}">
        </div>
    </div>
    
    {if $row.pid>0}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2" style="text-align:left; padding-left:50px; white-space:nowrap;">{:__('标识')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[is_need_vip]', ['1'=>__('设置为会员专属分类'), '0'=>__('不设置会员专属分类')],$row.is_need_vip)}
            <span class="help-block text-muted"><i class="fa fa-info-circle"></i> 会员标识仅在APP展示VIP图标，实际限制以试卷为准。</span>
        </div>
    </div>
    {/if}


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2" style="text-align:left; padding-left:50px; white-space:nowrap;">{:__('状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['1'=>__('启用'), '2'=>__('关闭')],$row.status)}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2" style="text-align:left; padding-left:50px; white-space:nowrap;"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
{include file="questioncategory/tpl" /}
